Various types of data streams contain both encoded video data and encoded audio data. Typically, a particular portion of the video data in a data stream corresponds with a particular portion of the audio data in the data stream. For example, if the video data is displaying a particular person speaking, the corresponding audio data presents the words or sounds uttered by that particular person. In this example, the presentation of the audio data should be synchronized with the presentation of the video data such that the movement of the speaker's lips at a particular moment corresponds to the word or sound being uttered.
A decoding device, such as a set-top box or other computing device, receives a data stream and decodes the video data and audio data contained in the data stream. The time required to decode and process the video data may differ from the time required to decode and process the audio data. This time difference may occur due to differences in the hardware components and/or software routines that process the video data and the audio data. Additionally, a particular time period of video data (e.g., one second) typically contains substantially more data than the same time period of audio data. Thus, the video data typically requires more processing than the audio data. Since the audio data may be processed faster than the video data, the audio data may not be ready for presentation while the video data is still being processed.
Additionally, different clock signals (having different frequencies) may be used for processing the video data and the audio data. If these clocks are not synchronized, the audio data and video data may not be processed at the same rate, thereby adding to the uncertainty of the timing relationship between the video data and analog data.
Therefore it is desirable to provide a delay mechanism that adjusts the presentation of the audio data and/or the presentation of the video data such that the audio data is presented in synchronization with the appropriate video data.